import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { UserComponent } from './user.component';

import { RegisterComponent } from './components/register/register.component'
import { HomeComponent } from './components/home/home.component';
import { HomedataComponent } from './components/homedata/homedata.component';
import { UserinfoComponent } from './components/userinfo/userinfo.component';
import { RenewComponent } from './components/renew/renew.component';
import { UpdateappComponent } from "./components/updateapp/updateapp.component"

const routes: Routes = [
  {
    path: 'register',
    component: RegisterComponent
  }, {
    path: 'home',
    component: HomeComponent,
    children: [
      { path: 'data', component: HomedataComponent },
      { path: 'userinfo', component: UserinfoComponent },
      { path: 'renew', component: RenewComponent },
      { path: 'update', component: UpdateappComponent }
    ]
  }, {
    path: '**',
    // component:UserComponent
    redirectTo: 'register'
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class UserRoutingModule { }
